import React from 'react';
import ReactDOM from 'react-dom'
import { BrowserRouter, Route, Switch, Link, } from 'react-router-dom'
import { createStore,applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import logger from 'redux-logger'

import Main from './main';
import reduxor from './redux'
import Login from './container/login/login';
import Qrscan from './component/qrscan/qrscan';

const store = createStore(reduxor, applyMiddleware(thunk, logger))

function App () {
    return (
        <Provider store={store}>
        <BrowserRouter>
            <div>
                <Switch>
                    <Route path="/login" component={Login} />
                    <Route path="/qrscan" component={Qrscan} />
                    <Route component={Main} />
                </Switch>
            </div>
        </BrowserRouter>
        </Provider>
    )
}

ReactDOM.render(<App/>, document.getElementById('root'))